# -*- coding: utf-8 -*- 
'''
Created on 2011-12-23

@author: TOM
'''
from django.db import models

class Menu(models.Model):  
    name=models.CharField(max_length=80) 
    url = models.CharField(max_length=100, default='-')  
    is_display = models.BooleanField(default=True) 
    is_leaf=models.BooleanField(default=True)
    is_navi=models.BooleanField(default=False)
    parent = models.ForeignKey('self',blank=True, null=True, related_name='child')  
    def __unicode__(self):  
        return self.name  
    

#        if has_next_value(self):
#            return next_value
#        else:
#            raise StopIteration   



# 系统静态值
#class SysDictionary(models.Model):  
#    STATES_CHOICES = (
#        ('1', '有效'),
#        ('0', '无效'),
#    )
#    # ID 
#    name=models.CharField(max_length=80,blank=True, null=True) # 静态值类型名称
#    key=models.CharField(max_length=255,blank=True, null=True)# 静态值id
#    value=models.CharField(max_length=255,blank=True, null=True)# 静态值value
#    desc=models.CharField(max_length=80,blank=True, null=True) # 静态值说明
#    state=models.IntegerField(max_length=10,choices=STATES_CHOICES)# 状态
#      
#    def __unicode__(self):  
#        return self.name  